﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BEPUphysics.NarrowPhaseSystems.Pairs;
using Microsoft.Xna.Framework;

namespace The_LarX
{
    public static class BepuUtil
    {
        public static bool CanJump(BepuEntity Entity)
        {
            foreach (CollidablePairHandler Col in Entity.Entity.CollisionInformation.Pairs)
            {
                foreach (ContactInformation contact in Col.Contacts)
                {
                    if ((float)Math.Acos(Math.Abs(contact.Contact.Normal.Y)) < MathHelper.PiOver4 &&
                        contact.Contact.Position.Y < Entity.Entity.Position.Y)
                    {
                        return true;
                    }
                }
            }
            return false;
        }
    }
}
